home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4292 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  25 lines

  1. Newsgroups: comp.lang.c
  2. Path: cwi.nl!dik
  3. From: dik@cwi.nl (Dik T. Winter)
  4. Subject: Re: Finding a prime number
  5. Message-ID: <DM69Hu.871@cwi.nl>
  6. Sender: news@cwi.nl (The Daily Dross)
  7. Nntp-Posting-Host: chrysant.cwi.nl
  8. Organization: CWI, Amsterdam
  9. References: <4e875s$nqk@reader2.ix.netcom.com> <4eqvk5$7tn@news.microsoft.com>
  10. Date: Fri, 2 Feb 1996 23:34:42 GMT
  11.  
  12. In article <4eqvk5$7tn@news.microsoft.com> a-cnadc@microsoft.com (Dann Corbit) writes:
  13.  > In article <4e875s$nqk@reader2.ix.netcom.com>, advtr@ix.netcom.co says...
  14.     [ if a mod 2 = a mod 3 = a mod 4 ... = a mod 9 = 0 then prime ]
  15. ...
  16.  >                                                  You also quit
  17.  > testing too soon for any number bigger than 49.  If you want to
  18.  > use modulo testing, you should divide by all primes up to the 
  19.  > square root of the input number.
  20.  
  21. Not 49, 120.  The test is with all primes up to the square root of 120.
  22. -- 
  23. dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland, +31205924098
  24. home: bovenover 215, 1025 jn  amsterdam, nederland; http://www.cwi.nl/~dik/
  25.